<template>
  <div></div>
</template>


<script>
export default {
  name: "TianDingCodeComponent",
  data() {
    return {
      user: null,
      code: "",
      state: "",
      router: ""
    };
  },
  mounted() {
    if (this.$route.query.code !== undefined) {
      this.code = this.$route.query.code;
    }

    this.user = this.local$.getItem("tdUser");
    
    if (!this.user) {
      this.router = "tdSelect";
    } else {
      this.router = "tdLogin";
    }

    location.href = `/${this.router}?code=${this.code}`;
  }
};
</script>
